<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/5/7
  Time: 19:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //获取项目的根路径
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <meta charset="utf-8">
    <title>药品查询页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="<%=basePath%>static/layui-v2.6.5/layui/css/layui.css">
    <link rel="stylesheet" href="<%=basePath%>static/drug/drugyan/css/drugSelect.css">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>static/swee/sweetalert.css">
    <script type="text/javascript" src="<%=basePath%>static/swee/sweetalert-dev.js"></script>
    <script src="<%=basePath%>static/jquery/jquery-1.12.4.js"></script>

</head>
<body>
<div id="head">
    <ul>
        <li>
            <div class="head_below1">
                <p class="odd-number">

                </p>
                <h2>华子医院处方笺查询</h2>
                <form action="<%=basePath%>drugY/drugPage" method="post">
                    <p>请输入诊疗号或身份号:<input type="text" name="id" placeholder="请输入" class="input1">
                        <button type="submit" class="layui-btn" value="1" name="all" style="margin-left: 20px">
                            查询最近七天记录
                        </button>
                        <button type="submit" class="layui-btn" value="1">查询全部</button>
                        <button type="submit" class="layui-btn" value="2" name="all2">查询未开药的</button>
                    </p>
                </form>
                <%--                存放查询结果--%>
                <div class="layui-form" style="margin-top: 20px">
                    <table class="layui-table" style="font-size: 10px">
                        <thead>
                        <tr>
                            <td>诊疗卡号</td>
                            <td>患者姓名</td>
                            <td>种数</td>
                            <td>年龄</td>
                            <td>性别</td>
                            <td>电话</td>
                            <td>身份证号</td>
                            <td>开药日期</td>
                            <td>开药医生</td>
                            <td>状态</td>
                            <td>详情</td>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="drug">
                            <tr>
                                <td>${drug.id}</td>
                                <td>${drug.name}</td>
                                <td>${drug.count}</td>
                                <td>${drug.age}</td>
                                <td>${drug.sex}</td>
                                <td>${drug.phone}</td>
                                <td>${drug.idCard}</td>
                                <td>${drug.date}</td>
                                <td>${drug.doctorName}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${drug.status==0}">
                                            未缴费
                                        </c:when>
                                        <c:when test="${drug.status==1}">
                                            已缴费未拿药
                                        </c:when>
                                        <c:otherwise>
                                            已缴费已拿药
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td>
                                    <button type="button" class="layui-btn layui-btn-sm"><i
                                            class="layui-icon"></i></button>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <p style="text-align: center">
                        <c:choose>
                        <c:when test="${page.list.size()>0}">
                        <a href="${pageContext.request.contextPath}/drugY/drugPage?id=${id}&pageNum=${page.firstPage}">首页</a>
                        <a href="${pageContext.request.contextPath}/drugY/drugPage?id=${id}pageNum=${page.prePage}">上一页</a>
                        <a href="${pageContext.request.contextPath}/drugY/drugPage?id=${id}pageNum=${page.nextPage}">下一页</a>
                        <a href="${pageContext.request.contextPath}/drugY/drugPage?id=${id}pageNum=${page.lastPage}">末页</a>
                        <span>第${page.pageNum}页/共${page.pages}页(${page.total}条记录)</span>
                        </c:when>
                        <c:otherwise>
                    <h2 style="text-align: center">没找到您需要的信息！</h2>
                    </c:otherwise>
                    </c:choose>
                    </p>
                </div>
            </div>
        </li>
    </ul>
</div>
</body>
</html>
<script type="text/javascript" src="<%=basePath%>static/drug/drugyan/js/drug.js"></script>
